package cn.dhnep.demo.controller;


import cn.dhnep.demo.pojo.vo.RespPageBean;
import cn.dhnep.demo.service.UserService;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author dhn
 * @since 2021-08-26
 */
@RestController
@RequestMapping("/dhn/user")
public class UserController {

    @Resource
    private UserService userService;

    @ApiOperation("获取所有用户")
    @GetMapping("getAllUser")
    public RespPageBean getAllUser(@RequestParam(defaultValue = "1") Integer page,
                                   @RequestParam(defaultValue = "15") Integer limit,
                                   @RequestParam(value = "gender", required = false) Integer gender,
                                   @RequestParam(value = "userName", required = false) String userName,
                                   @RequestParam(value = "nickName", required = false) String nickName){
        return userService.pageQueryAllUser(page,limit,gender,userName,nickName);
    }

}

